﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EasyTools.UI
{
    public partial class FrmDocTrans : Form
    {
        List<string> formats;

        public FrmDocTrans()
        {
            InitializeComponent();
            formats = new List<string>();
            formats.Add("unknown");
            formats.Add("pdf");
            formats.Add("docx");

            foreach (var f in formats) {
                comboBox1.Items.Add(f);
            }
        }

        private void textBox1_DoubleClick(object sender, EventArgs e)
        {
            var openResult = openFileDialog1.ShowDialog();
            if(openResult != DialogResult.OK && openResult != DialogResult.Yes)
            {
                return;
            }
            if (textBox1.Text == openFileDialog1.FileName)
            {
                return;
            }
            textBox1.Text = openFileDialog1.FileName;

            FileInfo fileInfo = new FileInfo(openFileDialog1.FileName);
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //textBox1
        }
        string src()
        {
            return "";
            //FileInfo fileInfo = new FileInfo(textBox1.Text);
            //fileInfo.Extension.ToLower();
        }

        private void textBox1_Leave(object sender, EventArgs e)
        {
            FileInfo fileInfo = new FileInfo(textBox1.Text);
            fileInfo.Extension.ToLower();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            /*
            PdfDocument pdf = new PdfDocument();            
            pdf.LoadFromFile(textBox1.Text);
            pdf.SaveToFile(textBox2.Text, FileFormat.DOCX);
            */
        }
    }
}
